import { defineConfig, loadEnv } from "vite";
import viteBaseConfig from "./vite.base.config";
import viteDevConfig from "./vite.dev.config";
import viteProdConfig from "./vite.prod.config";

export default defineConfig(({ command, mode }) => {
  const env = loadEnv(mode, process.cwd(), "");

  console.log(env.APP_KEY);

  console.log("mode", mode);
  if (command == "build") {
    return { ...viteBaseConfig, ...viteProdConfig };
  } else {
    return { ...viteBaseConfig, ...viteDevConfig };
  }
});
